%!TEX program = xelatex
%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass[12pt,t,aspectratio=169,mathserif]{beamer}
%Other possible values are: 1610, 149, 54, 43 and 32. By default, it is to 128mm by 96mm(4:3).
%run XeLaTeX to compile.

\input{wang-slides-preamble.tex}

\begin{document}

\title{高等代数二}
\subtitle{9-4-主轴问题 }
%\institute{上海立信会计金融学院}
%\author{王立庆}
\author{{\ppr LQW}}
\renewcommand{\today}{{\ppr \number\year \,年 \number\month \,月 \number\day \,日} }
%\date{{\ppr 2023年3月9日} }

\maketitle

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{3.1.1. }
\begin{frame}{9.4.i. 作业：星期天晚上十点半之前在网络教学平台提交 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}
\item   整理课堂笔记，补充没写完的计算或证明。
\item   习题(9.4)\#1,2,3,4, 抄写题目。
\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.ii. 目录 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}

\item[9.4.1.] 变量的正交变换
\item[9.4.2.] 实二次型的主轴问题
\item[9.4.3.] 椭圆的主轴 
\item[9.4.4.] 定理9.4.1. 实二次型经过正交变换化为只含平方项
\item[9.4.5.] 实对称阵正交相似于对角阵的例子 
\item[9.4.6.] 实二次型计算主轴的例子

\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{3.1.1. }
\begin{frame}{9.4.iii. 课堂讲解重点 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}
\item  实二次型经过正交变换化为只含平方项的实二次型
\item  计算主轴的方程
\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.1. 变量的正交变换 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}

\item  {\color{red}问题：什么是变量的正交变换？}

\item  解答：从变量 $X=(x_1,\cdots,x_n)^t$ 到变量 $Y=(y_1,\cdots,y_n)^t$ 的正交变换是指 $$X=UY,$$ 
其中矩阵 $U$ 是一个 $n$ 阶正交矩阵。


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.2. 实二次型的主轴问题 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}

\item  {\color{red}问题：什么是实二次型的主轴问题？}

\item  解答：给定实二次型 $q_1(X)$, 求正交矩阵 $U$, 通过变量代换 $X=UY$ 之后，得到的实二次型 $q_2(Y)=q_1(UY)$ 为只含有平方项的实二次型。


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.3. 椭圆的主轴 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}

\item  {\color{red}问题：平面曲线 $x^2+2y^2=10$ 是椭圆，写出它的长轴和短轴的方程。} 

\item  解答：
\begin{enumerate}
\item  长轴是 $x$ 轴，方程为 $y=0$. 
\item  短轴是 $y$ 轴，方程为 $x=0$. 
\end{enumerate}

%\begin{center}
\includegraphics[height=0.6\textheight, width=0.4\textwidth]{pic/slides_ellipse_9_4_2.png}
%\end{center}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.4. 定理9.4.1. 实二次型经过正交变换化为只含平方项 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red}定理：实二次型 $q_1(X)=X^{\,t}AX$ 总能通过变量的正交变换 $X=UY$ 化成
$q_2(Y) = \lambda_1y_1^2+\lambda_2y_2^2+\cdots+\lambda_n y_n^2$, 其中系数是矩阵 $A$ 的全部特征值。}

\item 证明：%这是本课程的重要定理之一。证明转化为分析相应的实对称阵。
\begin{enumerate}
\item  实对称矩阵的特征值都是实数。
\begin{enumerate}
\item  设在复数范围内有 $A\alpha=\lambda\alpha$. 
\item  记 $\bar{\alpha}^t$ 是列向量 $\alpha$ 的共轭转置，用两种方法计算 $\bar{\alpha}^tA\alpha$, 可得 $\bar{\lambda}=\lambda$. 
\end{enumerate}
\item  实对称矩阵的不同特征值的特征向量相互正交。
\begin{enumerate}
\item  设有 $A\alpha=\lambda\alpha$ 与 $A\beta=\mu\beta$. 
\item  用两种方法计算 ${\alpha}^tA\beta$, 可得 $\alpha^t\beta=0$. 
\end{enumerate}

\item  实对称矩阵正交相似于对角矩阵。
\begin{enumerate}
\item  将矩阵 $A$ 看作是 $\mathbb{R}^n$ 到自身的对称变换。
\item  设 $A\alpha=\lambda \alpha$. 
\item  设 $\beta\in L(\alpha)^\perp$, 则 $A\beta\in L(\alpha)^\perp$. 
\item  将 $A$ 限制在 $n-1$ 维子空间 $L(\alpha)^\perp$ 上，仍是对称变换。
\end{enumerate}

\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.5. 例子 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red}问题：设矩阵 {\footnotesize $A=\begin{pmatrix} 4&2&2 \\ 2&4&2 \\ 2&2&4 \end{pmatrix}$}. 
求正交矩阵 $U$ 使得 $U^{\,t}AU$ 为对角矩阵。
}

\item 解答：
\begin{enumerate}
\item  计算特征值 $\lambda=2,2,8$. 
\item  特征值 $\lambda=2$ 的线性无关的特征向量 $\eta_1=(-1,1,0)^t, \eta_2=(-1,0,1)^t$. 
\item  特征值 $\lambda=8$ 的特征向量 $\eta_3=(1,1,1)^t$.
\item  将特征向量正交化和单位化，求得正交矩阵
{\footnotesize $U = \frac{1}{\sqrt{6}}\begin{pmatrix} -\sqrt{3}&-1&\sqrt{2} \\ \sqrt{3}&-1&\sqrt{2} \\ 0&2&\sqrt{2} \end{pmatrix}$. }
%\item  $U^tAU=\text{diag}\{2,2,8\}$. 
\item  验证 \,{\footnotesize $U^tAU=\begin{pmatrix} 2&0&0 \\ 0&2&0 \\ 0&0&8 \end{pmatrix}$.}  
\end{enumerate}

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.6. 计算主轴的例子 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}

\item  {\color{red}问题：考虑实二次型 $q(x_1,x_2)=2x_1^2+4x_1x_2+5x_2^2$.}
\begin{enumerate}
\item  {\color{red}求可逆变换 $X=PY$ 使得 $q(PY)$ 化成 $y_1^2\pm y_2^2$ 的形式。} 
\item  {\color{red}求正交变换 $X=UY$ 使得 $q(UY)$ 化成 $\lambda_1y_1^2+\lambda_2 y_2^2$ 的形式。} 
\item  {\color{red}画出由方程 $q(x_1,x_2)=11$ 定义的平面曲线，写出主轴的方程。}
\end{enumerate}


\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.7. 例子解答\#1 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}

\item 解答：

\begin{enumerate}

\item  配方法可得 $q=2(x_1+x_2)^2+3x_2^2 = y_1^2 + y_2^2$, 
其中的变量代换为
{\footnotesize 
\begin{eqnarray*}
\left\{
\begin{array}{rcl}
y_1 &=& \sqrt{2} x_1+ \sqrt{2} x_2, \\ 
y_2 &=& \sqrt{3} x_2. 
\end{array}\right.
\end{eqnarray*}
}

\item  写出矩阵形式，可得变量代换为 
{\footnotesize 
\begin{eqnarray*}
\begin{pmatrix} y_1\\ y_2 \end{pmatrix} 
=\begin{pmatrix} \sqrt{2}&\sqrt{2} \\ 0&\sqrt{3}  \end{pmatrix} 
\begin{pmatrix}x_1 \\ x_2 \end{pmatrix}  
\,\,\, \Rightarrow \,\,\, 
\begin{pmatrix}x_1 \\ x_2 \end{pmatrix}
=\frac{1}{\sqrt{6}} \begin{pmatrix} \sqrt{3}&-\sqrt{2} \\ 0&\sqrt{2}  \end{pmatrix} 
\begin{pmatrix} y_1\\ y_2 \end{pmatrix}. 
\end{eqnarray*}
}

\end{enumerate}

\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.8. 例子解答\#2 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}\setcounter{enumi}{1}

\item 解答：

\begin{enumerate}

\item  实二次型 $q(x_1,x_2)=2x_1^2+4x_1x_2+5x_2^2$ 的对称矩阵 {\footnotesize $A = \begin{pmatrix} 2&2 \\ 2&5 \end{pmatrix}$}. 

\item  矩阵 $A$ 的特征值为 $1,6$, 相应的特征向量为 $(2,-1)^t, (1,2)^t$.

\item  将特征向量规范化，得正交矩阵 \,{\footnotesize $U = \frac{1}{\sqrt{5}} \begin{pmatrix} 2&1 \\ -1&2 \end{pmatrix}$}.

\item  因为 $U$ 是正交矩阵，所以 $U^{-1}=U^t$, 所以有 
\,{\footnotesize $U^tAU = U^{-1}AU = \begin{pmatrix} 1&0 \\ 0&6 \end{pmatrix}$}.

\item  设 $X=UY$, 则有 $q(UY) = (UY)^tA(UY) =Y^tU^tAUY = y_1^2+6y_2^2$. 

\end{enumerate}

\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.9. 例子解答\#3 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{enumerate}\setcounter{enumi}{2}

\item 解答：

\begin{enumerate}

\item  由 $X=UY$ 得 $Y = U^{-1}X = U^tX$, 即 
{\footnotesize 
 \begin{eqnarray*}
\begin{pmatrix} y_1\\ y_2 \end{pmatrix} 
= \frac{1}{\sqrt{5}} \begin{pmatrix} 2&-1 \\ 1&2  \end{pmatrix} 
\begin{pmatrix}x_1 \\ x_2 \end{pmatrix}. 
\end{eqnarray*}
}

\item  二次曲线的方程化为 $y_1^2+6y_2^2=11$. 
\item  在 $(y_1,y_2)$ 坐标系中，主轴为 $y_1$ 轴和 $y_2$ 轴，方程分别为 $y_2=0$ 与 $y_1=0$. 
\item  在 $(x_1,x_2)$ 坐标系中，主轴的方程分别为 $x_1+2x_2=0$ 与 $2x_1 - x_2=0$. 

\end{enumerate}

\end{enumerate}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{9.4.10. 例子解答\#3 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{center}
\includegraphics[height=0.8\textheight, width=0.5\textwidth]{pic/slides-9-4-4-ellipse.png}
\end{center}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile=singleslide]{9.4.11. 例子解答\#3 - Python代码 }
%\begin{frame}{9.4.4. Python代码 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\lstset{basicstyle=\scriptsize}
\begin{lstlisting}[language=Python]
import sympy as sy
import sympy.plotting as syp

x,y = sy.symbols('x,y')

p1 = syp.plot_implicit(2*x**2+4*x*y+5*y**2-11, (x,-4,4), (y,-4,4), show=False)
p2 = syp.plot_implicit(2*x-y, (x,-4,4), (y,-4,4), show=False)
p3 = syp.plot_implicit(x+2*y, (x,-4,4), (y,-4,4), show=False)

p1.extend(p2)
p1.extend(p3)
p1.show()

p1.save('slides_ellipse.png')
\end{lstlisting}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{习题(9.4)\#1 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red} 问题：对下述矩阵 $A$, 求正交矩阵 $U$, 使得 $U^tAU$ 为对角矩阵，
{\footnotesize 
\begin{eqnarray*}
A=\begin{pmatrix}  a&b \\ b&a  \end{pmatrix}, \,\, 
A=\begin{pmatrix}  2&-1&-1 \\ -1&2&-1 \\ -1&-1&2 \end{pmatrix}, \,\, 
A=\begin{pmatrix} 5&-2&0&0 \\ -2&2&0&0 \\ 0&0&5&-2 \\ 0&0&-2&2 \end{pmatrix}.  
\end{eqnarray*}
}
}

\item 思路：先求特征值和特征向量。再用正交化方法，求相互正交的特征向量。最后求出相互正交的单位长度的特征向量。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{习题(9.4)\#2 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red} 问题：设 $A$ 是正定对称矩阵。证明存在一个正定对称矩阵 $S$ 使得 $$A=S^2.$$ 
}

\item 思路：将对称矩阵正交相似于对角矩阵。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{习题(9.4)\#3 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red} 问题：设 $A$ 是可逆的实数矩阵。证明存在正定对称矩阵 $S$ 与正交矩阵 $U$, 使得 $A=US$. 
}

\item 思路：$A^tA$ 是正定对称矩阵。将 $A^tA$ 正交相似于对角矩阵。

\end{itemize}

\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{frame}[fragile=singleslide]{6.1.1. }
\begin{frame}{习题(9.4)\#4 }

\vspace{-0.4cm}\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.4pt}}
%每页详细内容

\begin{itemize}
\item  {\color{red} 问题：设 $A$ 与 $B$ 都是实对称矩阵，且 $AB=BA$. 证明存在正交矩阵 $U$ 使得 $U^tAU$ 与 $U^tBU$ 都是对角矩阵。

}

\item 思路：先证明 $A$ 与 $B$ 有一个公共的特征值。将 $A,B$ 都看作 $\mathbb{R}^n$ 到自身的线性变换。则 $A$ 的每个特征子空间都是 $B$ 的不变子空间。

\end{itemize}

\end{frame}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}










